<?php

session_start();
if(isset($_SESSION['callback']))
	{
	$contact = $_GET;
	if($contact['displayname']!="")
		$contact['name'] = $contact['displayname'];
	else
		$contact['name'] = $contact['email'];
	$profile = http_build_query($contact);
		$sUrlCallback = $_SESSION['callback'];
		unset($_SESSION['callback']);
		$sForm =  <<<EOF
<form action="$sUrlCallback" method="POST" id="yahoo_connect">
	<input name="contact" type="hidden" value="$profile"/>
	<input name="get_success" type="hidden" value="1"/>
</form>
<script language="JavaScript" type="text/javascript">
	window.onload = submitYahoo;
	function submitYahoo()
	{
		document.getElementById('yahoo_connect').submit();
	}
</script>
EOF;
		echo $sForm;
	}
?>
